/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 *//*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 *//*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 *//*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package poker_sim;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;

/**
 *
 * @author Mitch
 */
public class UI extends javax.swing.JFrame {

   
    Table t;

    /**
     * Creates new form UI
     */
    public UI() {
        initComponents();
        t = new Table(this);
        t.UpdateStats();
        
        
    }



    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane3 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jScrollPane1 = new javax.swing.JScrollPane();
        Jtable = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        Tablecards = new javax.swing.JTable();
        B_GO = new javax.swing.JButton();
        T_CARD1 = new javax.swing.JTextField();
        T_CARD2 = new javax.swing.JTextField();
        HandRankingState = new javax.swing.JTextField();
        NewHand = new javax.swing.JButton();
        vTableCards = new poker_sim.CardViewer();
        vHandCard = new poker_sim.CardViewer();
        HandRankViewer1 = new poker_sim.HandRankViewer();
        seatViewer1 = new poker_sim.SeatViewer();
        seatViewer2 = new poker_sim.SeatViewer();
        seatViewer3 = new poker_sim.SeatViewer();
        seatViewer4 = new poker_sim.SeatViewer();
        seatViewer6 = new poker_sim.SeatViewer();
        seatViewer5 = new poker_sim.SeatViewer();
        seatViewer7 = new poker_sim.SeatViewer();
        seatViewer8 = new poker_sim.SeatViewer();
        seatViewer9 = new poker_sim.SeatViewer();
        actionBar1 = new ActionBar();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(jTable1);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                OnWindowOpen(evt);
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        Jtable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Players", "Score", "Activity", "Amount", "Big/Small/Ante"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane1.setViewportView(Jtable);

        getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(1040, 20, 420, 175));

        Tablecards.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null}
            },
            new String [] {
                "Card 1", "Card 2", "Card 3", "Card 4", "Card 5"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane2.setViewportView(Tablecards);

        getContentPane().add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(976, 210, 480, 43));

        B_GO.setText("GO");
        B_GO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                B_GOActionPerformed(evt);
            }
        });
        getContentPane().add(B_GO, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 620, -1, -1));

        T_CARD1.setText("jTextField1");
        getContentPane().add(T_CARD1, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 550, 259, -1));

        T_CARD2.setText("jTextField2");
        getContentPane().add(T_CARD2, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 580, 259, -1));

        HandRankingState.setText("jTextField1");
        getContentPane().add(HandRankingState, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 580, 128, -1));

        NewHand.setActionCommand("NewHand");
        NewHand.setLabel("New Hand");
        NewHand.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NewHandActionPerformed(evt);
            }
        });
        getContentPane().add(NewHand, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 620, -1, -1));

        vTableCards.setBackground(new java.awt.Color(51, 153, 255));
        vTableCards.setPreferredSize(new java.awt.Dimension(365, 100));

        javax.swing.GroupLayout vTableCardsLayout = new javax.swing.GroupLayout(vTableCards);
        vTableCards.setLayout(vTableCardsLayout);
        vTableCardsLayout.setHorizontalGroup(
            vTableCardsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 365, Short.MAX_VALUE)
        );
        vTableCardsLayout.setVerticalGroup(
            vTableCardsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        getContentPane().add(vTableCards, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 160, 365, -1));

        vHandCard.setBackground(new java.awt.Color(51, 153, 255));

        javax.swing.GroupLayout vHandCardLayout = new javax.swing.GroupLayout(vHandCard);
        vHandCard.setLayout(vHandCardLayout);
        vHandCardLayout.setHorizontalGroup(
            vHandCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        vHandCardLayout.setVerticalGroup(
            vHandCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        getContentPane().add(vHandCard, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 440, 146, -1));

        HandRankViewer1.setBackground(new java.awt.Color(0, 153, 255));

        javax.swing.GroupLayout HandRankViewer1Layout = new javax.swing.GroupLayout(HandRankViewer1);
        HandRankViewer1.setLayout(HandRankViewer1Layout);
        HandRankViewer1Layout.setHorizontalGroup(
            HandRankViewer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 114, Short.MAX_VALUE)
        );
        HandRankViewer1Layout.setVerticalGroup(
            HandRankViewer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        getContentPane().add(HandRankViewer1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 500, -1, -1));
        getContentPane().add(seatViewer1, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 30, -1, -1));
        getContentPane().add(seatViewer2, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 50, -1, -1));
        getContentPane().add(seatViewer3, new org.netbeans.lib.awtextra.AbsoluteConstraints(800, 130, -1, -1));
        getContentPane().add(seatViewer4, new org.netbeans.lib.awtextra.AbsoluteConstraints(800, 270, -1, -1));
        getContentPane().add(seatViewer6, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 350, -1, -1));
        getContentPane().add(seatViewer5, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 350, -1, -1));
        getContentPane().add(seatViewer7, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 270, -1, -1));
        getContentPane().add(seatViewer8, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 110, -1, -1));
        getContentPane().add(seatViewer9, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 40, -1, -1));
        getContentPane().add(actionBar1, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 650, -1, -1));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void B_GOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_B_GOActionPerformed
       t.game();
    }//GEN-LAST:event_B_GOActionPerformed

    private void NewHandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NewHandActionPerformed
        t.NextHand();
        t.UpdateStats();
    }//GEN-LAST:event_NewHandActionPerformed

    private void OnWindowOpen(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_OnWindowOpen
        
    }//GEN-LAST:event_OnWindowOpen

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new UI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton B_GO;
    public poker_sim.HandRankViewer HandRankViewer1;
    public javax.swing.JTextField HandRankingState;
    public javax.swing.JTable Jtable;
    private javax.swing.JButton NewHand;
    public javax.swing.JTextField T_CARD1;
    public javax.swing.JTextField T_CARD2;
    public javax.swing.JTable Tablecards;
    private ActionBar actionBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private poker_sim.SeatViewer seatViewer1;
    private poker_sim.SeatViewer seatViewer2;
    private poker_sim.SeatViewer seatViewer3;
    private poker_sim.SeatViewer seatViewer4;
    private poker_sim.SeatViewer seatViewer5;
    private poker_sim.SeatViewer seatViewer6;
    private poker_sim.SeatViewer seatViewer7;
    private poker_sim.SeatViewer seatViewer8;
    private poker_sim.SeatViewer seatViewer9;
    public poker_sim.CardViewer vHandCard;
    public poker_sim.CardViewer vTableCards;
    // End of variables declaration//GEN-END:variables
}
